package com.design.model;

/**
 * def
 *
 * @author lw
 * @date 2023/12/4 14:38
 **/
public class DecoratorPatternExample {

    public static void main(String[] args) {
        Coffee coffee = new LuckingCoffee();
        System.out.println("Cost: $" + coffee.cost() + ", Description: " + coffee.description());

        Coffee milkCoffee = new MilkDecorator(coffee);
        System.out.println("Cost: $" + milkCoffee.cost() + ", Description: " + milkCoffee.description());

        Coffee sugarMilkCoffee = new SugarDecorator(milkCoffee);
        System.out.println("Cost: $" + sugarMilkCoffee.cost() + ", Description: " + sugarMilkCoffee.description());
    }
}
